import store from "@/store";
import { listTotree } from "@/utils/index";
// 此文件用于配置项和相关参数设置

// 详情展示页
// 基本信息
// 基础信息模块
const detailInfo = [{
        label: "设备名称",
        name: "name",
        value: "1"
    },
    {
        label: "固定资产编码",
        name: "fixAssetCode",
        value: "1"
    },
    {
        label: "设备编号",
        name: "deviceNumber",
        value: "1"
    },
    {
        label: "设备类别",
        name: "deviceType",
        value: "1"
    },
    {
        label: "设备分类",
        name: "deviceClass",
        value: "1"
    },
    {
        label: "使用部门",
        name: "useDepartment",
        value: "1"
    },
    {
        label: "责任人",
        name: "responsible",
        value: "1"
    },
    {
        label: "投产日期",
        name: "productDate",
        value: "1"
    },
    {
        label: "出厂编号",
        name: "factoryNumber",
        value: "1"
    },
    {
        label: "型号",
        name: "model",
        value: "1"
    },
    {
        label: "设备原值",
        name: "deviceValue",
        value: "1"
    },
    {
        label: "使用年限",
        name: "usedYears",
        value: "1"
    },
    {
        label: "设备主 图",
        name: "mainDrawFile",
        value: "1"
    }
];
const broadInfo = [{
        label: "扩展字段1",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段2",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段3",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段4",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段5",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段6",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段7",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段7",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段8",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段9",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段10",
        name: "name",
        value: "1"
    },
    {
        label: "扩展字段11",
        name: "name",
        span: 24,
        value: "123456781234567812345678123456781234567812345678"
    }
];
const histroyShowInfo = [{
        label: "一级 1",

        children: [{
            label: "二级 1-1",
            imgSrc: "https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png"
        }]
    },
    {
        label: "一级 2",
        children: [{
                label: "二级 2-1",
                imgSrc: "https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png"
            },
            {
                label: "二级 2-2",
                imgSrc: "https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png"
            }
        ]
    },
    {
        label: "一级 3",
        children: [{
                label: "二级 3-1",
                imgSrc: "https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png"
            },
            {
                label: "二级 3-2",
                imgSrc: "https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png"
            }
        ]
    }
];
const detailShowInfo = {
    detailInfo: detailInfo,
    broadInfo: broadInfo,
    histroyShowInfo: histroyShowInfo
};
// 基础信息表单配置
const formData = {
    title: "基础信息",
    formModel: {
        productName: "",
        productNumber: "",
        productModel: "",
        productType: "",
        usageType: "",
        productPrice: "",
        topLimit: "",
        bottomLimit: "",
        location: "",
        designer: "",
        brand: "",
        supplier: "",
        organId: ""
    },
    formComponent: [{
            type: "input",
            label: "备件名称",
            model: "productName",
            keyUpEnter: "handleFilter",
            rules: [{ required: true, message: "请输入备件名称", trigger: "blur" }]
        },
        {
            // span: 18,
            type: "input",
            label: "备件编号",
            model: "productNumber",
            option: [{ label: "定期", value: "0" }, { label: "日常", value: "1" }],
            rules: [{ required: true, message: "请输入备件编号", trigger: "blur" }]
        },
        {
            span: 5,
            type: "input",
            label: "型号规格",
            model: "productModel",
            // option: [1, 2, 3],
            rules: [{ required: true, message: "请输入型号规格", trigger: "blur" }]
        },
        {
            // span: 8,
            type: "select",
            label: "类别",
            model: "productType",

            options: [{ label: "自制", value: 0 }, { label: "外购", value: 1 }],
            rules: [{ required: true, message: "请选择类别", trigger: "blur" }]
        },
        {
            // span: 8,
            type: "select",
            label: "通用/专用",
            model: "usageType",

            options: [{ label: "通用", value: 0 }, { label: "专用", value: 1 }],
            rules: [{ required: true, message: "请选择通用/专用", trigger: "blur" }]
        },
        {
            // span: 11,
            type: "cascader",
            label: "归属部门",
            model: "organId",
            options: listTotree(store.state.app.allCode.department),
            rules: [{ required: true, message: "请选择归属部门", trigger: "blur" }]
        },
        {
            //  span: 11,
            type: "input",
            label: "库存报警下限",
            model: "bottomLimit"
                // option: [{ value: "1", label: "周一" }, { value: "2", label: "周二" }, { value: "3", label: "周三" }, { value: "4", label: "周四" }, { value: "5", label: "周五" }],
                // rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
        },
        {
            // span: 11,
            type: "input",
            label: "库存报警上限",
            model: "topLimit"
                // option: [{ value: "1", label: "周一" }, { value: "2", label: "周二" }, { value: "3", label: "周三" }, { value: "4", label: "周四" }, { value: "5", label: "周五" }],
                // rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
        },
        {
            type: "table"
        }
    ]
};
// 扩展字段信息
const broadData = {
    title: "扩展信息",
    formModel: {
        productPrice: "",
        designer: "",
        location: "",
        brand: "",
        supplier: ""
    },
    formComponent: [{
            type: "input",
            label: "单价",
            model: "productPrice"
                // option: [{ label: "指定人员", value: "0" }, { label: "指定部门", value: "1" }],
                // rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
        },
        {
            type: "input",
            label: "设计/承制方",
            model: "designer"
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                // rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
        },
        {
            type: "input",
            label: "保存地点",
            model: "location"
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                // rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
        },
        {
            type: "input",
            label: "品牌",
            model: "brand"
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                // rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
        },
        {
            type: "input",
            label: "供应商",
            model: "supplier"
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                // rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
        }
    ]
};
// 档案信息
const histroyInfo = {
    title: "档案信息",
    formModel: {
        archives: []
    },
    formComponent: [{
        type: "upload",
        label: "设备档案",
        model: "archives",
        keyUpEnter: "handleFilter"
            // rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
    }]
};
// 整理后的表单配置
const totalForm = [{
        formName: "基础信息",
        formRef: "table1", // 表单ref
        formModel: formData.formModel, // 表单model
        formComponent: formData.formComponent,
        formName: formData.title // 表单标题
    },
    {
        fromName: "扩展信息",
        formRef: "table2", // 表单ref
        formModel: broadData.formModel, // 表单model
        formComponent: broadData.formComponent,
        formName: broadData.title // 表单标题
    },
    {
        formName: "档案信息",
        formRef: "table3", // 表单ref
        formModel: histroyInfo.formModel, // 表单model
        formComponent: histroyInfo.formComponent,
        formName: histroyInfo.title, // 表单标题
        formStyle: "box-margin-card"
    }
];

const data = {
    totalForm: totalForm,
    // ----------表单显示相关---------//
    detailShowInfo: detailShowInfo
};
export default data;